package com.njtoyo.taxi.admin.mapper.master.mapper;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njtoyo.taxi.admin.library.Const;
import com.njtoyo.taxi.admin.mapper.master.entity.Company;
import com.njtoyo.taxi.admin.rest.presenter.business.CompanyListPresenter;
import com.njtoyo.taxi.admin.rest.wrapper.business.company.CompanyListWrapper;
import com.njtoyo.taxi.admin.rest.wrapper.finance.FinanceIncomeBelongStatWrapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author Dell
 * @since 2021-07-14
 */
@Repository
@DS(Const.PRIMARY_DS)
public interface CompanyMapper extends BaseMapper<Company> {
    Page<CompanyListPresenter> selectCompanyList(CompanyListWrapper companyListWrapper);

    Page<Map<String, Object>> selectInfoServiceById(@Param("page") Page page, @Param("companyId") Integer companyId, @Param("selectStartDate") String selectStartDate, @Param("selectEndDate") String selectEndDate);

    BigDecimal sumInfoServiceById(@Param("companyId") Long id);

    BigDecimal selectCompanyAmount(@Param("wrapper") FinanceIncomeBelongStatWrapper wrapper);

    Map<String, Object> selectCompanyAmountById(@Param("wrapper") FinanceIncomeBelongStatWrapper wrapper);
}
